package com.dq.Week2.day09.pritice;

public class Hero {
    private String name;
    private int hp;
    private int atk;

    public Hero(){}

    public Hero(String name, int hp, int atk) {
        this.name = name;
        this.hp = hp;
        this.atk = atk;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getAtk() {
        return atk;
    }

    public void setAtk(int atk) {
        this.atk = atk;
    }

    @Override
    public boolean equals(Object another) {
        if(this==another)
        {
            return true;
        }
        if(another instanceof Hero)
        {
            Hero hero = (Hero) another;
            if(((Hero) another).getName()==this.getName() &&((Hero) another).getAtk()==this.getAtk()&&((Hero) another).getHp()==this.getHp())
            {
                return  true;
            }
        }

        return false;
    }
}
